﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace KillProcesss
{
    public partial class Form2 : Form
    {
      
        public Form2()
        {
            InitializeComponent();
            toolTip1.SetToolTip(button1,"Найти файл");
        }

        private void button1_Click(object sender, EventArgs e)
        {
            System.Diagnostics.ProcessStartInfo startInfo = null;
            try
            {
                startInfo = new System.Diagnostics.ProcessStartInfo("Explorer");   //процесс на старт
                startInfo.UseShellExecute = false;
                startInfo.Arguments = @"/select," + textBox4.Text;  //аргементы для данного процесса - это путь и выделение
                System.Diagnostics.Process p = System.Diagnostics.Process.Start(startInfo);
            }
            catch (Exception) { }
            finally
            {
                if (startInfo != null) startInfo = null;
            }
        }

        private void Form2_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Escape)
                this.Close();
        }
    }
}
